package wangxiaotao.utils;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

//@Component
//@ConfigurationProperties(prefix = "md5")
public class MD5Utils {
    private static String salt;
    private static Integer hashIterations;

    public void setSalt(String salt) {
        MD5Utils.salt = salt;
    }

    public void setHashIterations(Integer hashIterations) {
        MD5Utils.hashIterations = hashIterations;
    }

    public static String MD5Encode(String source){
        System.out.println(salt);
        System.out.println(hashIterations);
        //加盐再设置散列次数的md5
//        Md5Hash md5Hash = new Md5Hash(source,salt,hashIterations);
//        Md5Hash md5Hash = new Md5Hash(source,"fasfadf",3);
//        return md5Hash.toString();
        return "";
    }
//    private Integer MD5Decode(String code){
//        Md5
//    }
}
